/*
 * copyright (c) 2009 Alexandr [Sn@ble] Surnin
 *
 * This file is part of CVP.
 *
 * CVP is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * CVP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You can read the full version of GNU LGPL in
 * http://www.gnu.org/copyleft/lesser.html
 */


#include "fileinfo.h"

FileInfo::FileInfo(QWidget *parent) : QWidget(parent) {

    mainLayout = new QVBoxLayout();



    commonInfo = new QGroupBox(tr("Common"));
    commonInfoLayout = new QGridLayout();
    commonInfo->setLayout(commonInfoLayout);

    fileNameLabelLeft = new QLabel(tr("File Name: "));
    fileNameLabelRight = new QLabel(tr("Unknown"));
    commonInfoLayout->addWidget(fileNameLabelLeft, 1, 1);
    commonInfoLayout->addWidget(fileNameLabelRight, 1, 2);

    fileSizeLabelLeft = new QLabel(tr("File Size: "));
    fileSizeLabelRight = new QLabel(tr("Unknown"));
    commonInfoLayout->addWidget(fileSizeLabelLeft, 2, 1);
    commonInfoLayout->addWidget(fileSizeLabelRight, 2, 2);

    movieLenghtLeft = new QLabel(tr("Lenght: "));
    movieLenghtRight = new QLabel(tr("Unknown"));
    commonInfoLayout->addWidget(movieLenghtLeft, 3, 1);
    commonInfoLayout->addWidget(movieLenghtRight, 3, 2);

    mainLayout->addWidget(commonInfo);



    videoInfo = new QGroupBox(tr("Video"));
    videoInfoLayout = new QGridLayout();
    videoInfo->setLayout(videoInfoLayout);

    videoCodecLabelLeft = new QLabel(tr("Codec: "));
    videoCodecLabelRight = new QLabel(tr("Unknown"));
    videoInfoLayout->addWidget(videoCodecLabelLeft, 1, 1);
    videoInfoLayout->addWidget(videoCodecLabelRight, 1, 2);

    videoFramesLabelLeft = new QLabel(tr("Frames count: "));
    videoFramesLabelRight = new QLabel(tr("Unknown"));
    videoInfoLayout->addWidget(videoFramesLabelLeft, 2, 1);
    videoInfoLayout->addWidget(videoFramesLabelRight, 2, 2);

    videoFPSLabelLeft = new QLabel(tr("FPS: "));
    videoFPSLabelRight = new QLabel(tr("Unknown"));
    videoInfoLayout->addWidget(videoFPSLabelLeft, 3, 1);
    videoInfoLayout->addWidget(videoFPSLabelRight, 3, 2);

    videoBitRateLabelLeft = new QLabel(tr("BitRate: "));
    videoBitRateLabelRight = new QLabel(tr("Unknown"));
    videoInfoLayout->addWidget(videoBitRateLabelLeft, 4, 1);
    videoInfoLayout->addWidget(videoBitRateLabelRight, 4, 2);

    mainLayout->addWidget(videoInfo);



    audioInfo = new QGroupBox(tr("Audio"));
    audioInfoLayout = new QGridLayout();
    audioInfo->setLayout(audioInfoLayout);

    audioCodecLabelLeft = new QLabel(tr("Codec: "));
    audioCodecLabelRight = new QLabel(tr("Unknown"));
    audioInfoLayout->addWidget(audioCodecLabelLeft, 1, 1);
    audioInfoLayout->addWidget(audioCodecLabelRight, 1, 2);

    audioSamplesLabelLeft = new QLabel(tr("Samples count: "));
    audioSamplesLabelRight = new QLabel(tr("Unknown"));
    audioInfoLayout->addWidget(audioSamplesLabelLeft, 2, 1);
    audioInfoLayout->addWidget(audioSamplesLabelRight, 2, 2);

    audioBitRateLabelLeft = new QLabel(tr("BitRate: "));
    audioBitRateLabelRight = new QLabel(tr("Unknown"));
    audioInfoLayout->addWidget(audioBitRateLabelLeft, 3, 1);
    audioInfoLayout->addWidget(audioBitRateLabelRight, 3, 2);

    mainLayout->addWidget(audioInfo);



    mainLayout->addStretch();

    setLayout(mainLayout);
}


void FileInfo::setFileName(QString _fileName) {

    fileName = _fileName;
    fileNameLabelRight->setText(fileName);
}


void FileInfo::setFileSize(QString _fileSize) {

    fileSize = _fileSize;
    fileSizeLabelRight->setText(fileSize);
}


void FileInfo::setMovieLenght(QString _movieLenght) {

    movieLenght = _movieLenght;
    movieLenghtRight->setText(movieLenght);
}


void FileInfo::setVideoCodecName(QString _videoCodecName) {

    videoCodecName = _videoCodecName;
    videoCodecLabelRight->setText(videoCodecName);
}


void FileInfo::setVideoFramesCount(QString _videoFramesCount) {

    videoFramesCount = _videoFramesCount;
    videoFramesLabelRight->setText(videoFramesCount);
}


void FileInfo::setVideoFPS(QString _videoFPS) {

    videoFPS = _videoFPS;
    videoFPSLabelRight->setText(videoFPS);
}


void FileInfo::setVideoBitRate(QString _videoBitRate) {

    videoBitRate = _videoBitRate;
    videoBitRateLabelRight->setText(videoBitRate);
}


void FileInfo::setAudioCodecname(QString _audioCodecName) {

    audioCodecName = _audioCodecName;
    audioCodecLabelRight->setText(audioCodecName);
}


void FileInfo::setAudioSamplesCount(QString _audioSampesCount) {

    audioSamplesCount = _audioSampesCount;
    audioSamplesLabelRight->setText(audioSamplesCount);
}


void FileInfo::setAudioBitRate(QString _audioBitRate) {

    audioBitRate = _audioBitRate;
    audioBitRateLabelRight->setText(audioBitRate);
}


